/*    */ package com.zimbra.cs.index.query;
/*    */ 
/*    */ import com.zimbra.cs.index.DBQueryOperation;
/*    */ import com.zimbra.cs.index.QueryOperation;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class ConvCountQuery
/*    */   extends Query
/*    */ {
/*    */   private int lowestCount;
/*    */   private boolean lowerEq;
/*    */   private int highestCount;
/*    */   private boolean higherEq;
/*    */   
/*    */   private ConvCountQuery(int lowestCount, boolean lowerEq, int highestCount, boolean higherEq)
/*    */   {
/* 37 */     this.lowestCount = lowestCount;
/* 38 */     this.lowerEq = lowerEq;
/* 39 */     this.highestCount = highestCount;
/* 40 */     this.higherEq = higherEq;
/*    */   }
/*    */   
/*    */   public void dump(StringBuilder out)
/*    */   {
/* 45 */     out.append("ConvCount:");
/* 46 */     out.append(this.lowerEq ? ">=" : ">");
/* 47 */     out.append(this.lowestCount);
/* 48 */     out.append(' ');
/* 49 */     out.append(this.higherEq ? "<=" : "<");
/* 50 */     out.append(this.highestCount);
/*    */   }
/*    */   
/*    */   void sanitizedDump(StringBuilder out)
/*    */   {
/* 55 */     out.append("ConvCount:");
/* 56 */     out.append(this.lowerEq ? ">=" : ">");
/* 57 */     out.append("$NUM");
/* 58 */     out.append(' ');
/* 59 */     out.append(this.higherEq ? "<=" : "<");
/* 60 */     out.append("$NUM");
/*    */   }
/*    */   
/*    */   public boolean hasTextOperation()
/*    */   {
/* 65 */     return false;
/*    */   }
/*    */   
/*    */   public QueryOperation compile(Mailbox mbox, boolean bool)
/*    */   {
/* 70 */     DBQueryOperation op = new DBQueryOperation();
/* 71 */     op.addConvCountRange(this.lowestCount, this.lowerEq, this.highestCount, this.higherEq, evalBool(bool));
/* 72 */     return op;
/*    */   }
/*    */   
/*    */   public static Query create(String term) {
/* 76 */     if (term.charAt(0) == '<') {
/* 77 */       boolean eq = false;
/* 78 */       if (term.charAt(1) == '=') {
/* 79 */         eq = true;
/* 80 */         term = term.substring(2);
/*    */       } else {
/* 82 */         term = term.substring(1);
/*    */       }
/* 84 */       int num = Integer.parseInt(term);
/* 85 */       return new ConvCountQuery(-1, false, num, eq); }
/* 86 */     if (term.charAt(0) == '>') {
/* 87 */       boolean eq = false;
/* 88 */       if (term.charAt(1) == '=') {
/* 89 */         eq = true;
/* 90 */         term = term.substring(2);
/*    */       } else {
/* 92 */         term = term.substring(1);
/*    */       }
/* 94 */       int num = Integer.parseInt(term);
/* 95 */       return new ConvCountQuery(num, eq, -1, false);
/*    */     }
/* 97 */     int num = Integer.parseInt(term);
/* 98 */     return new ConvCountQuery(num, true, num, true);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/index/query/ConvCountQuery.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */